Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.wpi.cetask
Class Plan

    java.lang.Object
      edu.wpi.cetask.Plan

    public class Plan

extends Object

Constructor Summary
`Plan(Task goal)`

Method Summary
`void` | `add(Plan plan)` Add given plan as child of this plan.
`void` | `apply(DecompositionClass type)`
`Iterator<Plan>` | `children()`
`void` | `decomposeAll()`
`void` | `execute()` System executes script for goal of this plan.
`List<Plan>` | `findMatches(Task task, boolean onlyLive)` Return list of plans in this plan tree whose goal matches given task.
`List<Plan>` | `findMatches(Task task, boolean onlyLive, Plan exclude)` Return list of plans in this plan tree whose goal matches given task.
`List<Plan>` | `getBlockers()`
`Decomposition` | `getDecomposition()`
`Task` | `getGoal()`
`List<Plan>` | `getLive()` Return list of live children of this plan.
`List<Plan>` | `getLiveDescendants()` Return list of live descendants of this plan.
`List<Object>` | `getNotes()` Return list of notes to be added to verbose printing of this plan.
`Plan` | `getParent()`
`boolean` | `hasFailed()` Test whether this plan has any failed contributing children.
`boolean` | `hasLiveDescendants()` Test whether this plan has any live descendants.
`boolean` | `isAncestor(Plan plan)` Test whether given plan can be reached from this plan by following parents.
`boolean` | `isComplete()` Tests whether this plan has been decomposed (either by applying a DecompositionClass or procedurally) and all the non-optional steps are done.
`boolean` | `isDecomposed()`
`boolean` | `isDescendant(Plan plan)` Test whether given plan can be reached from this plan by following children.
`boolean` | `isDone()` Tests whether plans which require this plan should become live.
`boolean` | `isFailed()`
`boolean` | `isLive()`
`boolean` | `isOptional()`
`boolean` | `isPassed()`
`boolean` | `isRequired(Plan plan)`
`boolean` | `isStarted()`
`boolean` | `occurred()`
`void` | `print(PrintStream stream)`
`void` | `print(PrintStream stream, int indent)`
`void` | `recognize(Task task)` Recognize given task as matching this plan and copy slot values.
`void` | `remove(Plan child)` Remove given child of this plan.
`void` | `requires(Plan plan)`
`void` | `setDecomposed(boolean decomposed)`
`void` | `setOptional(boolean optional)`
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Plan

    public Plan(Task goal)

Method Detail

### getGoal

    public Task getGoal()

  Returns:
    the task which this plan is supposed to achieve

### getNotes

    public List<Object> getNotes()

  Return list of notes to be added to verbose printing of this plan. This is convenience feature for applications to manage by side effect.

  See Also:
    `print(PrintStream)`

### setOptional

    public void setOptional(boolean optional)

### isOptional

    public boolean isOptional()

### getParent

    public Plan getParent()

### isAncestor

    public boolean isAncestor(Plan plan)

  Test whether given plan can be reached from this plan by following parents. Note plan is not its own ancestor.

### isDescendant

    public boolean isDescendant(Plan plan)

  Test whether given plan can be reached from this plan by following children. Note plan is not its own descendant.

### children

    public Iterator<Plan> children()

  Returns:
    iterator for children of this plan.

### add

    public void add(Plan plan)

  Add given plan as child of this plan.

### remove

    public void remove(Plan child)

  Remove given child of this plan.

  Parameters:
    `child` - - must be child of this plan

### requires

    public void requires(Plan plan)

### isRequired

    public boolean isRequired(Plan plan)

### execute

    public void execute()

  System executes script for goal of this plan.

### occurred

    public boolean occurred()

### isDone

    public boolean isDone()

  Tests whether plans which require this plan should become live.

### isFailed

    public boolean isFailed()

### isLive

    public boolean isLive()

### isComplete

    public boolean isComplete()

  Tests whether this plan has been decomposed (either by applying a DecompositionClass or procedurally) and all the non-optional steps are done. Note that even if this method returns true (and this plan is therefore done), it may still have optional ("trailing") children that are live.

  See Also:
    `isDecomposed()`, `isDone()`, `isPassed()`

### isPassed

    public boolean isPassed()

### getBlockers

    public List<Plan> getBlockers()

### getLive

    public List<Plan> getLive()

  Return list of live children of this plan.

### getLiveDescendants

    public List<Plan> getLiveDescendants()

  Return list of live descendants of this plan.

### hasLiveDescendants

    public boolean hasLiveDescendants()

  Test whether this plan has any live descendants.

### hasFailed

    public boolean hasFailed()

  Test whether this plan has any failed contributing children.

### isStarted

    public boolean isStarted()

### recognize

    public void recognize(Task task)

  Recognize given task as matching this plan and copy slot values. If given task is occurrence, then also check for failure (false postcondition) in ancestor plans.

### isDecomposed

    public boolean isDecomposed()

### setDecomposed

    public void setDecomposed(boolean decomposed)

### getDecomposition

    public Decomposition getDecomposition()

### apply

    public void apply(DecompositionClass type)

### decomposeAll

    public void decomposeAll()

### findMatches

    public List<Plan> findMatches(Task task,
                                  boolean onlyLive)

  Return list of plans in this plan tree whose goal matches given task.

  Parameters:
    `onlyLive` - only search live plans

### findMatches

    public List<Plan> findMatches(Task task,
                                  boolean onlyLive,
                                  Plan exclude)

  Return list of plans in this plan tree whose goal matches given task.

  Parameters:
    `onlyLive` - only search live plans
    `exclude` - do not search given plan

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### print

    public void print(PrintStream stream)

  See Also:
    `getNotes()`

### print

    public void print(PrintStream stream,
                      int indent)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD